﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CmsSiteAdminFlag.aspx.cs"
    Inherits="Manage_Cms_CmsSiteAdminFlag" %>

<%@ Import Namespace="KeRui.Common" %>
<html>
<head>
    <link rel="icon" href="../pic/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="../pic/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/style.css" type="text/css" />

    <script src="../js/global.js"></script>

    <link rel="stylesheet" href="../Themes/<%=ManageHelper.GetTheme()%>/style.css" type="text/css" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8">

    <script type="text/javascript" language="javascript">          
        function WebsitePermissions_CheckAll(chk){
	        var oEvent = document.getElementById('WebsitePermissions');
	        var chks = oEvent.getElementsByTagName("INPUT");
	        for(var i=0; i<chks.length; i++)
	        {
		        if(chks[i].type=="checkbox") chks[i].checked=chk.checked;
	        }
        }
    </script>

</head>
<body>
    <form id="myForm" name="myForm" method="post" action="?id=<%=PageRequest.GetInt("id",-1) %>&siteID=<%=PageRequest.GetString("siteID") %>">
        <input type="hidden" name="act" value="action" />
        <div class="column">
            <div class="columntitle">
                <%=modelCmsSite.SiteName%>
                &nbsp;-&nbsp;与站点相关权限设置</div>
            <table width="100%" cellpadding="4" cellspacing="0" border="0">
                <tr>
                    <td align="left">
                        <input type="checkbox" onclick="WebsitePermissions_CheckAll(this)" id="CheckAll2"
                            name="CheckAll2"><label for="CheckAll2">全选</label>
                        <table id="WebsitePermissions" border="0">
                            <%
                                for (int i = 0; i < listAdminFlag.Count; i++)
                                {
                                    if (i % 6 == 0)
                                    {     
                            %>
                            <tr>
                                <td>
                                    <input id="WebsitePermissions_<%=listAdminFlag[i].ID %>" type="checkbox" <%
                                    if(list != null)
                                    {
                                        for (int ii = 0; ii < sysRole.Split(',').Length; ii++)
                                        {
                                            if (sysRoles[ii] ==
                                                listAdminFlag[i].Flag + "_" + PageRequest.GetInt("siteID", -1))
                                            {
                                                Response.Write("checked='checked'");
                                            }
                                            else
                                            {
                                                Response.Write(string.Empty);
                                            }
                                        }
                                    }%> name="websitePermissions" value="<%=listAdminFlag[i].Flag+"_"+PageRequest.GetInt("siteID", -1) %>" /><label
                                        for="WebsitePermissions_<%=listAdminFlag[i].ID %>"><%=listAdminFlag[i].FlagName %></label></td>
                                <%}
                                  else
                                  {%>
                                <td>
                                    <input id="WebsitePermissions_<%=listAdminFlag[i].ID %>" type="checkbox" name="websitePermissions"
                                        <%
                                            if(list != null)
                                            {
                                                for (int ii = 0; ii < sysRole.Split(',').Length; ii++)
                                                {
                                                    if (sysRoles[ii] ==
                                                        listAdminFlag[i].Flag + "_" + PageRequest.GetInt("siteID", -1))
                                                    {
                                                        Response.Write("checked='checked'");
                                                    }
                                                    else
                                                    {
                                                        Response.Write(string.Empty);
                                                    }
                                                }
                                            }%> value="<%=listAdminFlag[i].Flag+"_"+PageRequest.GetInt("siteID", -1)  %>" /><label
                                                for="WebsitePermissions_<%=listAdminFlag[i].ID %>"><%=listAdminFlag[i].FlagName %></label></td>
                                <%if (i % 6 == 0)
                                  { %>
                            </tr>
                            <%}
                          }
                      } %>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <table width="95%" align="center" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                </td>
                <td align="center">
                    <input type="submit" name="sub" value="确 定" id="Submit" class="button" />&nbsp;&nbsp;
                    <input type="submit" name="sub" value="返 回" id="Return" class="button" />
                </td>
                <td>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
